#include "vector.h"

#ifndef _STACK_H_
#define _STACK_H_

template <typename T>
class Stack : public Vector<T> {
   public:
    void push(T const& e);
    T pop();
    T& top();
};

template <typename T>
void Stack<T>::push(T const& e) {
    insert(this->size(), e);
    return;
}

template <typename T>
T Stack<T>::pop() {
    return remove(this->size() - 1);
}

template <typename T>
T& Stack<T>::top() {
    return (*this)[this->size() - 1];
}

#endif